package com.dyna.auth.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dyna.api.domain.entity.SystemOath2Client;

import java.util.Collection;

public interface Oath2ClientService extends IService<SystemOath2Client> {

    /**
     * 从缓存中，校验客户端是否合法
     *
     * @return 客户端
     */
    default SystemOath2Client validOAuthClientFromCache(String clientId) {
        return validOAuthClientFromCache(clientId, null, null, null, null);
    }

    /**
     * 从缓存中，校验客户端是否合法
     *
     * @return 客户端
     */
    SystemOath2Client validOAuthClientFromCache(String clientId, String clientSecret, String authorizedGrantType,
                                                Collection<String> scopes, String redirectUri);

}
